package cn.afterturn.easypoi.word.entity.bookmark;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
@Data
@Entity
@Table(name = "fileVO", schema = "jeecg-boot-sjk", catalog = "")
public class FileVO {
    @Id
    @Column(name = "id")
    private String id;
    private Long versionno=System.currentTimeMillis();//时间点作为版本号
    private String clientfilename;
    @JsonIgnore
    private String serverfilepath;//
    private String filesuffixname;
    /*@Max(value=10485760,message = "文件大小必须小于10M=10*1024*1024")
    @Min(value=1024,message = "文件大小必须大于1K")*/
    //@Size(max=10485760, min=1024,message ="文件大小必须大于1K,小于10M=10*1024*1024" )
    private Long filesize;
    //@NotBlank(message = "文件的MD5不能为空")
    private String md5;
    @JsonIgnore
    private String username;
    //    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @JsonIgnore //如果在在一个标签@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")。@JsonIgnore 就会失效
    //属于Jackson同类型的标签，Jsonignore优先级低。不同类型的书签如验证标签与Jackson标签相互不影响
    private Date wordgeneratortime;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date wordClientCommitTime;
    @JsonIgnore
    private Date wordServerReceiveTime;
    /**创建人*/
    @JsonIgnore
    private String create_by;
    /**创建日期*/

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonIgnore
    private Date create_time;
    /**更新人*/
    @JsonIgnore
    private String update_by;
    /**更新日期*/

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//这个标签与Ignore不会冲突
    @JsonIgnore
    private Date update_time;
    /**所属部门*/
    @JsonIgnore
    private String sysOrgCode;

}
